package com.ymk.cmd;

import com.ymk.base.cmd.ACmd;
import com.ymk.base.cmd.CmdSign;
import com.ymk.base.exception.MallException;
import com.ymk.base.utlis.ParamsBuilder;
import com.ymk.bo.member.MemberBO;
import com.ymk.bo.member.MemberFinanceLogBO;
import com.ymk.core.code.cmd.MemberCmdCode;
import com.ymk.core.code.req.ReqCode;
import com.ymk.core.enums.FunTypeEnum;
import com.ymk.core.enums.member.MemberFinanceBizTypeEnum;
import com.ymk.service.IMemberFinanceLogService;
import com.ymk.service.IMemberService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;

@Service
public class MemberPatchCmd extends ACmd {

    @Override
    public CmdSign executeMop(HttpServletRequest request, CmdSign sign) throws Exception {
        CmdSign respSign = new CmdSign(sign);
        MemberBO reqData = super.getData(sign, MemberBO.class);

        this.memberService.update(reqData);

        return respSign;
    }

    @Override
    public CmdSign executeStore(HttpServletRequest request, CmdSign sign) throws Exception {
        CmdSign respSign = new CmdSign(sign);
        MemberBO reqData = super.getData(sign, MemberBO.class);
        this.memberService.update(reqData);
        return respSign;
    }

    @Override
    public String getCmdCode() {
        return MemberCmdCode.MEMBER_PATCH;
    }

    @Autowired
    private IMemberService memberService;
    @Autowired
    private IMemberFinanceLogService memberFinanceLogService;
}